import django.db.models as models
from ticket.exceptions import TransientFailure, PermanentFailure

class BoringModel(models.Model):
    """
    dummy model for django-ticket unit tests
    """
    name=models.CharField(blank=True, max_length=64)

    def __unicode__(self):
        return self.name

def test_func():
    """
    exists only to excercise the function importing infrastructure
    """
    pass
def preen(inst):
    inst.preened=True
    print "preened %s with pk %s" % (inst.__class__.__name__, str(inst.pk))
    return inst
def temporary_fail_to_preen(inst):
    raise TransientFailure("transient error of some kind!", inst)
def permanent_fail_to_preen(inst):
    raise PermanentFailure("permanent error of some kind!", inst)
def unexpected_fail_to_preen(inst):
    raise Exception("Some kind of hideous unexpected error!", inst)